import java.util.Scanner;

public class Road{
    public static void main(String[] args) {
        Car[] car = new Car[3];
        car[0] = new LittleCar(0,0.0,0.0,0,"品牌","颜色");
        System.out.println();
        car[1] = new Truck(0,0,0,0,0,0);
        System.out.println();
        car[2] = new Motorbike(0,0,0,0,"原产地");
        System.out.println();
        Scanner input = new Scanner(System.in);
        for (int i = 0; i < car.length; i++) {
            System.out.println("设定转速");
            int inputt = input.nextInt();  
            System.out.println("设定车轮半径");
            double inputr = input.nextDouble();
            System.out.println("设定使用时间");
            double inputu = input.nextDouble();
            System.out.println("设定限载乘客数");
            int inputp = input.nextInt();
            System.out.println();
            car[i].setTurnrate(inputt);
            car[i].setRadius(inputr);
            car[i].setUsetime(inputu);
            car[i].setPassanger(inputp);
            int flag = car[i].chooseType(car[i]);
            if(flag == 0){
                LittleCar l = (LittleCar) car[i];
                System.out.println("设定汽车涂装色");
                input.nextLine();
                String inputc = input.nextLine();
                System.out.println("设定汽车品牌");
                String inputb = input.nextLine();
                l.setColor(inputc);
                l.setBrand(inputb);
            }
            if(flag ==1){
                Truck t =(Truck) car[i];
                System.out.println("设定货车高度");
                double inputh = input.nextDouble();
                System.out.println("设定载货量");
                double inputs =input.nextDouble();
                t.setHeight(inputh);
                t.setStorage(inputs);
            }
            if(flag ==2){
                Motorbike m = (Motorbike) car[i];
                input.nextLine();
                System.out.println("设定原产地");
                String inputn =input.nextLine();
                m.setNativespot(inputn);
            }
            car[i].getFuntion();
            car[i].getValue();
            car[i].warnSafe();
        }
    }
}